#ifndef D_DRAWBRIDGEELEMENT_H
#define D_DRAWBRIDGEELEMENT_H

#include <wx/gdicmn.h>
#include "D-DrawBaseElement.h"
#include "D-DrawBaseBridgeElement.h"

class wxClientDC;
class wxDC;
class wxPoint;
class wxSize;

static const int bridge_max_nodes = 256;
const int bridge_line_width = 5;

class D_DrawBridgeElement : public D_DrawBaseBridgeElement{
	public:		
	D_DrawBridgeElement(wxPoint* position);
	D_DrawBridgeElement();
	virtual ~D_DrawBridgeElement();
	virtual unsigned char* ToByteBuffer(int& buffer_length);
	virtual void Render(wxDC* dc, wxPoint* offset);	
	virtual void FromByteBuffer(unsigned char* buffer, int buffer_length);
	virtual void SetZBuffer(int depth);
	virtual int GetZBuffer();
	virtual wxPoint* GetPosition();
	virtual void SetPosition(wxPoint position);
	virtual wxSize* GetSize();
	virtual void SetSize(wxSize size);
	virtual D_DrawBaseElement* Clone();
	bool AddNode(wxPoint position);
	bool SetNode(wxPoint position, int index);
	void Complete();
	int GetNodeAmount();
	void SetNodeAmount(int amount);
	wxPoint GetNode(int index);
	void SetSource(int index);
	void SetDestination(int index);
	int GetSource();
	int GetDestination();
	int GetZBufferForDrawing();
	protected:
	void RenderArrow(wxPoint* current_position, wxPoint* previous_position, wxDC* dc);
	int m_source_element_index;
	int m_destination_element_index;
	wxPoint m_nodes[bridge_max_nodes];
	static wxPoint shared_bridge_list[bridge_max_nodes];
	int m_nodes_length;
	};
#endif